package com.rqf.ls.service.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import com.rqf.ls.service.ICommonDataService;
import com.rqf.ls.service.ILawyerRecommendService;
import com.server.web.DataVector;
import com.server.web.RequestInput;

@Service("LawyerRecommendService")
public class LawyerRecommendService implements ILawyerRecommendService {

	@Autowired
	private JdbcTemplate jdbcTemplate;
	@Autowired
	private ICommonDataService commonDataService;
	
	 /**
	 * 获取与用户相关的律师列表
	 * @return
	 * @author ServerZhang
	 * @date 2016年3月28日
	 */
	@Override
	public List<Map<String, Object>> getList(){
		String sql = "Select * from lsuser where able=1";
		List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
		if (list.size() > 0) {
			return list;
		}else {
			return new ArrayList<Map<String,Object>>();
		}
	}
	@Override
	public DataVector<Map<String, Object>> getList(RequestInput requestInput){
		String table = "lsuser";
		String _whereStr = "able=1 and INBLACKLIST=0 and CHECKED=1";
		String sortStr = "REGISTTIME desc";
		DataVector<Map<String, Object>> listData = commonDataService.getListData(table, _whereStr, sortStr, requestInput);
		return listData;
	}
	
	
}
